# @summary A short summary of the purpose of this class
#
# A description of what this class does
#
# @example
#   include clusters::ipv6
class clusters::ipv6 (
 $ipv6addr       = hiera('clusters::ipv6::ipv6addr', undef),
 $ipv6_defaultgw = hiera('clusters::ipv6::ipv6_defaultgw', undef),
){
  if $ipv6addr != undef {
  if $facts['os']['release']['major'] < '8' {
    network::interface { $facts['networking']['primary']:
      bootproto          => "dhcp",
      onboot             => "yes",
      ipv6init           => "yes",
      ipv6_autoconf      => "no",
      ipv6_addr_gen_mode => "stable-privacy",
      ipv6addr           => "$ipv6addr",
      ipv6_defaultgw     => "$ipv6_defaultgw",
    }
  }
  else {
    anchor { 'clusters::ipv6::begin':   } ->
    class  { 'clusters::ipv6::config':  } ~>
    class  { 'clusters::ipv6::service': } ->
    anchor { 'clusters::ipv6::end':     }
  }
  }
}
